package hrms.service;

import hrms.dao.FinanceMapper;
import hrms.entity.Finance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("FinanceService")
public class FinanceService {
    @Autowired
    FinanceMapper financeMapper;

    public List<Finance> findAllFinances(){
        return financeMapper.selectAll();
    }

    public List<Finance> findByDate(Integer year, Integer month){
        return financeMapper.selectByDate(year, month);
    }

    public void addFinance(Finance finance){
        financeMapper.insert(finance);
    }

    public void updateFinance(Finance finance){
        financeMapper.insert(finance);
    }
}
